package vcp.views;
import java.awt.event.ActionListener;
import java.util.Observable;
import java.util.Observer;
import javax.swing.JOptionPane;

import client.Message;
import db.parking.beans.Employee;
import vcp.common.AbstractView;
import vcp.common.IView;
import vcp.gui.forms.LoginForm;
import vcp.test.entities.User;

public class LoginView extends AbstractView implements IView {
    private LoginForm loginForm=null;
    public LoginView(){
    	loginForm = getLoginForm();
    }
    
    public LoginForm getLoginForm() {
    	if(this.loginForm==null)
    		this.loginForm = new LoginForm();
    	return loginForm;
	}

	@Override
	public void addController(Object obj) {
		loginForm.getBtnLogin().addActionListener((ActionListener)obj);
		loginForm.getBtnLogin().setActionCommand("login");
	}

	//@Override
	//public void update(Observable o, Object arg) {
		//Message tempMsg = (Message)arg; 
		//Employee e = (Employee) tempMsg.getObj();
		/*
		switch(tempMsg.getMsg())
		 {
		 	case "Login":
				if(tempMsg.isStatus())
				{
					JOptionPane.showMessageDialog(null , "Welcome "+ e.getEmpName());
				}	
				else
				{
					JOptionPane.showMessageDialog(null,"ERROR: " + tempMsg.getStatusMsg(),"DATABASE ERROR",JOptionPane.ERROR_MESSAGE);
				}
				break;
		 }
		 */	
	//}

}
